<template>
	<div>
    <div
      class="search_template"
      style="background:white;height:120px;"
    >
      <div
        class="content"
        style="height: 80px; display: flex; justify-content: space-around;align-items: center;">
        <div>
          <span style="color:#888; font-weight:800;">功能名称:</span>
          <el-input
            v-model="search"
            placeholder="请输入功能名称搜索"
            @keyup.enter.native="onEnterSearch"
            style="width:200px;height50px;"
          />
        </div>
        <div align="right">
          <el-button size="mini" icon="el-icon-search" type="success" @click="onEnterSearch">点击查询</el-button>
        </div>
      </div>
      <div align="left" style="margin-left:10px">
        <el-button size="mini" type="primary" plain icon="el-icon-plus" @click="dialogFormVisible_two = true">新增</el-button>
      </div>
    </div>
 
		<el-container style="height: 500px; border: 1px solid #eee;overflow-y:scroll;">
			<el-container
				style="width:200px;margin-right:5px;overflow-y:scroll;padding-left: 10px;padding-right: 20px;background: #fff;padding-top:5px"
			>
				<el-tree :data="data_two" ref="tree_one" :accordion="true" node-key="id" @node-click="getCheckedKeys"></el-tree>
			</el-container>
			<el-container>
				<!-- <router-view></router-view> -->
				<el-table :data="tableData" border  style="width: 100%">
					<el-table-column align="center" label="功能编码" prop="menuCode"></el-table-column>
					<el-table-column align="center" label="功能名称" prop="menuName"></el-table-column>
					<el-table-column align="center" label="父功能名称" prop="parentName"></el-table-column>
					<el-table-column align="center" label="功能类型" prop="menuType"></el-table-column>
					<el-table-column align="center" label="URL" prop="urlPath"></el-table-column>
					<el-table-column align="center" label="操作">
						<template slot-scope="scope">
							<el-button size="mini" type="primary" plain @click="modify_display(scope.row.menuId)">修改</el-button>
							<el-button size="mini" type="danger" plain @click="open(scope.row.menuId)">删除</el-button>
						</template>
					</el-table-column>
				</el-table>
				<el-dialog title="新增功能" :visible.sync="dialogFormVisible_two" :before-close="close">
					<el-form
						:model="dynamicValidateForm"
						ref="dynamicValidateForm"
						label-width="100px"
						class="demo-dynamic"
					>
						<el-form-item
							prop="add_menuCode"
							label="功能编码"
							:rules="[
		      { required: true, message: '请输入功能编码', trigger: 'blur' },
		    
		    ]"
						>
							<el-input v-model="dynamicValidateForm.add_menuCode"></el-input>
						</el-form-item>
						<el-form-item
							prop="add_menuName"
							label="功能名称"
							:rules="[
			    { required: true, message: '请输入功能名称', trigger: 'blur' },
			  
			  ]"
						>
							<el-input v-model="dynamicValidateForm.add_menuName"></el-input>
						</el-form-item>
						<el-form-item
							label="功能类型"
							:rules="[
			    { required: true, message: '请选择功能类型', trigger: 'blur' },
			  
			  ]"
						>
							<!--  <el-select v-model="dynamicValidateForm" placeholder="请选择">
			      <el-option label="目录" value="M"></el-option>
			      <el-option label="菜单" value="C"></el-option>
				   <el-option label="按钮" value="F"></el-option>
							</el-select>-->
							<el-select v-model="value_one" placeholder="请选择">
								<el-option
									v-for="item in options"
									:key="item.value"
									:label="item.label"
									:value="item.value"
								></el-option>
							</el-select>
						</el-form-item>
						<el-form-item
							prop="add_parentName"
							label="父功能"
							:rules="[
			    { required: true, message: '请输入父功能', trigger: 'blur' },
			  
			  ]"
						>
							<el-input v-model="dynamicValidateForm.add_parentName"></el-input>
						</el-form-item>
						<el-form-item
							prop="add_urlPath"
							label="URL"
							:rules="[
			    { required: true, message: '请输入URL', trigger: 'blur' },
			  
			  ]"
						>
							<el-input v-model="dynamicValidateForm.add_urlPath"></el-input>
						</el-form-item>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="close">取 消</el-button>
						<el-button type="primary" @click="new_onSubmit(dynamicValidateForm)">确 定</el-button>
					</div>
				</el-dialog>
				<!-- 	<el-dialog title="新增功能" :visible.sync="dialogFormVisible_two">
			
			<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
			  <el-form-item
			    prop="new_role_name"
			    label="角色名称"
			    :rules="[
			      { required: true, message: '请输入角色名称', trigger: 'blur' },
			    
			    ]"
			  >
			    <el-input v-model="dynamicValidateForm.new_role_name"></el-input>
			  </el-form-item>
			  <el-form-item
			    prop="name_code"
			    label="角色编码"
			    :rules="[
			      { required: true, message: '请输入角色编码', trigger: 'blur' },
			    
			    ]"
			  >
			    <el-input v-model="dynamicValidateForm.name_code"></el-input>
			  </el-form-item>
			 
			    <el-form-item label="角色描述" 
				prop="desc"
				:rules="[
				  { required: true, message: '请输入角色描述', trigger: 'blur' },
				
				]"
				>
			      <el-input type="textarea" v-model="dynamicValidateForm.desc"
				
				  ></el-input>
				  
			    </el-form-item>
			
				<el-form-item label="角色权限"
				:rules="[
				  { required: true, message: '请选择角色权限', trigger: 'blur' },
				
				]"
				>
				     <el-tree
				        :data="data"
				        show-checkbox
				        node-key="id"
				        ref="tree"
				        :expand-on-click-node="false"
				        :render-content="renderContent">
				      </el-tree>
				
				</el-form-item>
			 
			</el-form>
			
		  <div slot="footer" class="dialog-footer">
			  <el-button @click="dialogFormVisible_two = false">取消</el-button>
			  <el-button type="primary" @click="new_onSubmit(dynamicValidateForm)">确定</el-button>
			   
		    
		  </div>
				</el-dialog>-->
				<!--修改功能-->
				<!-- <el-dialog title="修改功能" :visible.sync="dialogFormVisible_three">
			<el-form :model="dynamicValidateForm_modify" ref="dynamicValidateForm_modify" label-width="100px" class="demo-dynamic">
			  <el-form-item
			    prop="new_role_name_modify"
			    label="角色名称"
			    :rules="[
			      { required: true, message: '请输入角色名称', trigger: 'blur' },
			    
			    ]"
			  >
			    <el-input v-model="dynamicValidateForm_modify.new_role_name_modify"></el-input>
			  </el-form-item>
			 <el-form-item
			   prop="name_code_modify"
			   label="角色编码"
			   :rules="[
			     { required: true, message: '请输入角色编码', trigger: 'blur' },
			   
			   ]"
			 >
			   <el-input v-model="dynamicValidateForm_modify.name_code_modify"></el-input>
			 </el-form-item>
			    <el-form-item label="角色描述" 
				prop="desc_modify"
				:rules="[
				  { required: true, message: '请输入角色描述', trigger: 'blur' },
				
				]"
				>
			      <el-input type="textarea" v-model="dynamicValidateForm_modify.desc_modify"
				
				  ></el-input>
				  
			    </el-form-item>
			
				<el-form-item label="角色权限"
				:rules="[
				  { required: true, message: '请选择角色权限', trigger: 'blur' },
				
				]"
				>
				
						<el-tree
						   :data="data"
						   show-checkbox
						   node-key="id"
						   ref="tree_modify"
						   :expand-on-click-node="false"
						   :render-content="renderContent">
						 </el-tree>
			
				  
				</el-form-item>
			 
			</el-form>
			
		  <div slot="footer" class="dialog-footer">
			  <el-button type="primary" @click="onSubmit_modify(dynamicValidateForm_modify)">确定</el-button>
			   <el-button @click="dialogFormVisible_three = false" >取消</el-button>
		  
		  </div>
				</el-dialog>-->

				<!--修改功能-->
				<!--最新修改功能-->
				<el-dialog title="修改功能" :visible.sync="dialogFormVisible_three" :destroy-on-close="true">
					<el-form
						:model="dynamicValidateForm_modify"
						ref="dynamicValidateForm_modify"
						label-width="100px"
						class="demo-dynamic"
					>
						<el-form-item
							prop="add_menuCode"
							label="功能编码"
							:rules="[
			      { required: true, message: '请输入功能编码', trigger: 'blur' },
			    
			    ]"
						>
							<el-input v-model="dynamicValidateForm_modify.add_menuCode"></el-input>
						</el-form-item>
						<el-form-item
							prop="add_menuName"
							label="功能名称"
							:rules="[
				    { required: true, message: '请输入功能名称', trigger: 'blur' },
				  
				  ]"
						>
							<el-input v-model="dynamicValidateForm_modify.add_menuName"></el-input>
						</el-form-item>
						<el-form-item
							label="功能类型"
							:rules="[
				    { required: true, message: '请选择功能类型', trigger: 'blur' },
				  
				  ]"
						>
							<!--  <el-select v-model="dynamicValidateForm" placeholder="请选择">
				      <el-option label="目录" value="M"></el-option>
				      <el-option label="菜单" value="C"></el-option>
					   <el-option label="按钮" value="F"></el-option>
							</el-select>-->
							<el-select v-model="value_two" placeholder="请选择">
								<el-option
									v-for="item in options"
									:key="item.value"
									:label="item.label"
									:value="item.value"
								></el-option>
							</el-select>
						</el-form-item>
						<el-form-item
							prop="add_parentName"
							label="父功能"
							:rules="[
				    { required: true, message: '请输入父功能', trigger: 'blur' },
				  
				  ]"
						>
							<el-input v-model="dynamicValidateForm_modify.add_parentName"></el-input>
						</el-form-item>
						<el-form-item
							prop="add_urlPath"
							label="URL"
							:rules="[
				    { required: true, message: '请输入URL', trigger: 'blur' },
				  
				  ]"
						>
							<el-input v-model="dynamicValidateForm_modify.add_urlPath"></el-input>
						</el-form-item>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="dialogFormVisible_three= false">取 消</el-button>
						<el-button type="primary" @click="onSubmit_modify(dynamicValidateForm_modify)">确 定</el-button>
					</div>
				</el-dialog>
				<!--最新修改功能-->
				<!--最新的修改功能-->
				<!-- <el-dialog title="修改功能" :visible.sync="dialogFormVisible_three">
			
			<el-form :model="dynamicValidateForm_modify" ref="dynamicValidateForm_modify" label-width="100px" class="demo-dynamic">
			  <el-form-item
			    prop="email"
			    label="功能编码"
			    :rules="[
			      { required: true, message: '请输入功能编码', trigger: 'blur' },
			    
			    ]"
			  >
			    <el-input v-model="dynamicValidateForm_modify.email"></el-input>
			  </el-form-item>
				<el-form-item
				  prop="email"
				  label="功能名称"
				  :rules="[
				    { required: true, message: '请输入功能名称', trigger: 'blur' },
				  
				  ]"
				>
				  <el-input v-model="dynamicValidateForm_modify.email"></el-input>
				</el-form-item>
				
				  <el-form-item label="功能类型"
				  :rules="[
				    { required: true, message: '请选择功能类型', trigger: 'blur' },
				  
				  ]"
				  >
				    <el-select v-model="dynamicValidateForm_modify" placeholder="请选择">
				      <el-option label="功能1" value="shanghai"></el-option>
				      <el-option label="功能2" value="beijing"></el-option>
				    </el-select>
				  </el-form-item>
				<el-form-item
				  prop="email"
				  label="父功能"
				  :rules="[
				    { required: true, message: '请输入父功能', trigger: 'blur' },
				  
				  ]"
				>
				  <el-input v-model="dynamicValidateForm_modify.email"></el-input>
				</el-form-item>
				<el-form-item
				  prop="email"
				  label="URL"
				  :rules="[
				    { required: true, message: '请输入URL', trigger: 'blur' },
				  
				  ]"
				>
				  <el-input v-model="dynamicValidateForm_modify.email"></el-input>
				</el-form-item>
			
			</el-form>
			
		  <div slot="footer" class="dialog-footer">
			  
		   <el-button @click="dialogFormVisible = false">取 消</el-button>
		    <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
		  </div>
				</el-dialog>-->

				<!--最新的修改功能-->
			</el-container>
		</el-container>
		<el-container style="margin-top:20px;margin-bottom:20px;float:right;margin-right:20px">
			<el-pagination
				@size-change="handleSizeChange"
				@current-change="handleCurrentChange"
				:current-page="currentPage"
				:page-sizes="[5, 10, 20, 40]"
				:page-size="pagesize"
				layout="total,sizes, prev, pager, next, jumper"
				:total="total_one"
			></el-pagination>
		</el-container>
	</div>
</template>
<style>
.el-header {
    background-color: #b3c0d1;
    color: #333;
    line-height: 60px;
}

.el-aside {
    color: #333;
}
</style>

<script>
import {
    getUserInfo,
    deleteUser,
    getUserJurisdiction,
    add_role_role,
    get_role_jurisdiction,
    getModifyUserInfo,
    modify_role_role,
    get_menu_list,
    add_menu,
    get_echo_display,
    modify_menu_menu,
    delect_menu_menu,
	get_menu_menu_tree,
	menuListSearch
} from '@/api/user';
export default {
    data() {
        return {
            tableData: [],
            search: '',
            dialogTableVisible: false,
            dialogFormVisible: false,
            dialogTableVisible_two: false,
            dialogFormVisible_two: false,
            dialogTableVisible_three: false,
            dialogFormVisible_three: false,
            /*****添加功能的form******/
            dynamicValidateForm: {
                add_menuCode: '',
                add_menuName: '',
                add_parentName: '',
                add_menuType: '',
                add_urlPath: ''
            },
            data_two: [],
            /******添加功能的form****/
            /******修改的form*******/
            dynamicValidateForm_modify: {
                add_menuCode: '',
                add_menuName: '',
                add_parentName: '',
                add_menuType: '',
                add_urlPath: ''
            },
            role_id_id: '',
            /******修改的form*******/

            data: [],
            /*********新增的目录选择***********/
            options: [
                {
                    value: 'M',
                    label: '目录'
                },
                {
                    value: 'C',
                    label: '菜单'
                },
                {
                    value: 'F',
                    label: '按钮'
                }
            ],
            value_one: '',
            value_two: '',
            currentPage: 1,
            pagesize: 10,
            total_one: 0,
            check_id: ''
            /********新增的目录选择*********/
        };
    },

    // methods: {
    //   handleEdit(index, row) {
    //     console.log(index, row);
    //   },
    //   handleDelete(index, row) {
    //     console.log(index, row);
    //   }
    // },
    /********获取用户列表***********/
    created() {
        // var getUserInfo_params={
        // 	token: "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjM5MzczZDUwLWRkZWUtNDMzOC1iNWE1LWI5OGE0NzBjNzY3NSJ9.s-rok9MHQpnLH8unFriyHwc8_8NBFeCR7zzj-sgbdUR9u-QZxu-zINqGOj2Okv74UftPbro2pAqTYrGtwPfbjw"
        // }
        // this.load_jiaose_list()

        /*******获取功能里的树**********/
        this.get_tree();
        /********获取功能里的树*********/
        /**********获取添加角色里的权限************/
        get_role_jurisdiction()
            .then(response => {
                if (response.data.code == 200) {
                    console.log('获取添加角色里的权限', response);
                    // this.tableData=response.data.rows
                    this.data = response.data.data;
                } else {
                    this.$message.error(response.data.msg);
                }
            })
            .catch(() => {});
        /**********获取添加角色里的权限***********/
    },
    /********获取用户列表**********/
    /**********删除功能***************/
    methods: {
        close() {
            this.dialogFormVisible_two = false;
            this.$refs.dynamicValidateForm.resetFields();
            this.value_one = '';
        },
        /******导航栏跳转功能********/
        handleSelect() {
            // console.log("===")
            this.$router.push({ path: '/article' });
        },
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            // console.log(key, keyPath);
        },
        /******导航栏跳转功能*********/
        open(index) {
            console.log('==--', index);
            // console.log("000000",row);
            this.$confirm('您确定要删除这条信息吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
                center: true
            })
                .then(() => {
                    /*****点击了确认*******/

                    var roleId = {
                        menuId: index
                    };
                    delect_menu_menu(roleId)
                        .then(response => {
                            if (response.data.code == 200) {
                                // var getUserInfo_params={
                                // 	token: "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjM5MzczZDUwLWRkZWUtNDMzOC1iNWE1LWI5OGE0NzBjNzY3NSJ9.s-rok9MHQpnLH8unFriyHwc8_8NBFeCR7zzj-sgbdUR9u-QZxu-zINqGOj2Okv74UftPbro2pAqTYrGtwPfbjw"
                                // }
                                this.get_tree();
                                this.tableData = '';
                                // this.load_jiaose_list(this.check_id)
                                this.$message({
                                    message: '删除成功',
                                    type: 'success'
                                });
                            } else {
                                this.$message.error(response.data.msg);
                            }
                        })
                        .catch(() => {
                            // console.log("我是点击了取消")
                        });
                    /******点击了确认********/
                })
                .catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
        },
        /********删除功能****************/
        /**********修改功能数据回显*************/
        // dialogFormVisible_three(){
        // 	console.log("我是点击了数据回显功能")
        // }
        // var getUserInfo_params={
        // 	token:"eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjAzMmU1MzJmLWI0NzQtNDNhOS1hZDEyLTI4MWUxZjUzNTI3NSJ9.CTOxnzaje_jLhg8xR0XKVOM8f48Hhe03Q4wET3SytwonmxrBtlKYLSMaSkRm3zyNvPe0Kx2OTOWA5_-0mKHDBg"
        // }
        // 	getUserInfo(getUserInfo_params).then((response) => {
        // 	  if (response.data.code == 200) {
        // 			// console.log("我特别需要的数据",response.data.rows)
        // 			this.tableData=response.data.rows
        // 	  } else {
        // 	    this.$message.error(response.data.msg);

        // 	  }
        // 	}).catch(() => {

        // 	})
        // handleClose(done) {
        //      this.$confirm('确认关闭？')
        //        .then(_ => {
        //          done();
        //        })
        //        .catch(_ => {});
        //    }
        onSubmit() {
            console.log('submit!');
        },

        /**********修改功能数据回显*************/
        /*******树形结构********/
        renderContent(h, { node, data, store }) {
            return (
                <span class="custom-tree-node">
                    <span>{node.label}</span>
                </span>
            );
        },

        //     getCheckedKeys() {
        //       console.log("通过key选中",this.$refs.tree.getCheckedKeys());
        // },

        /********树形结构**********/
        /**********添加角色的功能****************/
        new_onSubmit(dynamicValidateForm) {
            console.log('===博阳现在需要的数据---', dynamicValidateForm);

            this.dialogFormVisible_two = false;
            // this.$refs[dynamicValidateForm].validate((valid) => {

            // if (valid) {
            //   alert('submit!');
            // } else {
            //   console.log('error submit!!');
            //   return false;
            // }
            // });
            /********调用新增接口***********/
            // var roleId={
            // 	roleIds:[index]
            // }

            var new_add_params = {
                menuCode: dynamicValidateForm.add_menuCode,
                menuName: dynamicValidateForm.add_menuName,
                parentName: dynamicValidateForm.add_parentName,
                menuType: this.value_one,
                urlPath: dynamicValidateForm.add_urlPath
            };
            this.value_one = '';
            this.$refs.dynamicValidateForm.resetFields();

            add_menu(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.get_tree();
                        this.tableData = '';
                        // this.load_jiaose_list(this.check_id)
                        this.$message({
                            message: '添加成功',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {
                    // console.log("我是点击了取消")
                });
            /*******调用新增接口*********/
            console.log('我是新增接口');
        },
        /*********添加角色的功能**************/
        /********加载角色列表********/
        load_jiaose_list(menuId) {
            var params_list={
            	pageNum:this.currentPage,
            	pageSize:this.pagesize,
                menuId: menuId
            }
            // var params_list = {
            // };
            // console.log('boyagn', params_list);
            get_menu_list(params_list)
                .then(response => {
                    console.log('---我是博阳====', response);
                    if (response.data.code == 200) {
                        // console.log("我特别需要的数据",response.data.rows)
                        this.tableData = response.data.data;
                        this.total_one=response.data.total;
                      this.pageSize = response.data.pageSize;
                      this.pageNum = response.data.pageNum;
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {
                    console.log('我是点击了取消');
                });
        },

        /*******加载角色列表********/
        /**********角色修改功能*************/
        /********修改数据回显********/
        modify_display(role_id) {
            console.log('===---hhhh', role_id);
            this.role_id_id = role_id;
            this.dialogFormVisible_three = true;
            var getUserInfo_params = {
                menuId: role_id
            };
            console.log('==', getUserInfo_params);

            get_echo_display(getUserInfo_params)
                .then(response => {
                    if (response.data.code == 200) {
                        // console.log("我特别需要的数据",response.data.rows)
                        console.log('我需要的数据数据回显', response);
                        // dynamicValidateForm_modify: {
                        //        new_role_name_modify: '',
                        // 		name_code_modify:'',
                        // 		desc_modify:''
                        //     },

                        (this.value_two = response.data.data.menuType),
                            (this.dynamicValidateForm_modify.add_menuCode = response.data.data.menuCode);
                        this.dynamicValidateForm_modify.add_menuName = response.data.data.menuName;
                        this.dynamicValidateForm_modify.add_parentName = response.data.data.parentName;

                        this.dynamicValidateForm_modify.add_urlPath = response.data.data.urlPath;
                        console.log('我需要的数据', this.dynamicValidateForm_modify);
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /********修改数据的回显********/
        onSubmit_modify(dynamicValidateForm_modify) {
            this.dialogFormVisible_three = false;
            // this.$refs[dynamicValidateForm].validate((valid) => {
            console.log('我需要的数据', dynamicValidateForm_modify);
            // if (valid) {
            //   alert('submit!');
            // } else {
            //   console.log('error submit!!');
            //   return false;
            // }
            // });
            /********调用新增接口***********/
            // var roleId={
            // 	roleIds:[index]
            // }

            var new_add_params = {
                menuId: this.role_id_id,
                menuCode: dynamicValidateForm_modify.add_menuCode,
                menuName: dynamicValidateForm_modify.add_menuName,
                parentName: dynamicValidateForm_modify.add_parentName,
                menuType: this.value_two,
                urlPath: dynamicValidateForm_modify.add_urlPath
            };
            console.log('===我需要的修改数据----', new_add_params);

            modify_menu_menu(new_add_params)
                .then(response => {
                    console.log('我是添加角色', response);
                    if (response.data.code == 200) {
                        this.get_tree();
                        // this.load_jiaose_list(this.check_id)
                        this.tableData = '';
                        this.$message({
                            message: '修改成功',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {
                    console.log('我是点击了取消');
                });
            /*******调用新增接口*********/
            console.log('我是新增接口');
        },
        handleSizeChange: function(size) {
            this.pagesize = size;
            this.load_jiaose_list();

            // console.log("我是当前页下拉",this.pagesize)
        },
        handleCurrentChange: function(currentPage) {
            this.currentPage = currentPage;
            this.load_jiaose_list();
            // console.log("我是当前页====下拉",this.currentPage)
        },
        /*******获取树的名称***********/
        getCheckedKeys(id) {
            var deptId = id.id;
            var check_id = deptId;
            this.load_jiaose_list(deptId);
        },
        get_tree() {
            var data_data = {};

            get_menu_menu_tree(data_data)
                .then(response => {
                    console.log('我们需要的树', response);
                    if (response.data.code == 200) {
                        this.data_two = response.data.data;
                        console.log('===', this.data_two);
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /********获取树的名称***********/
		/*********角色修改功能************/
        onEnterSearch(e, searchVal) {
            /***********调用模糊查询接口***************/

            var new_add_params = {
                pageNum: 1,
                pageSize: 10,
                menuName: this.search //功能名称搜索
            };
			console.log(this.search)
            menuListSearch(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.tableData = response.data.data.list;
                        this.$message({
                            message: '查询成功',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
            /*********调用模糊查询的接口**************/
        },
        /**********模糊查询搜索功能****************/
    }
};
</script>